330 FOR X=1 TO L(0):PRINT X;" ";Q$(X);RIGHT$(C$,25-LEN(Q$(X)));D$(X):NEXT X
335 INPUT "Item number to be changed `0' if none ";X
340 IF X=0 THEN 370: REM ---If none then save the results
345 IF (X<1) OR (X>L(0)) THEN 335: REM---Out of range data value
350 PRINT Q$(X);"Should be ";:INPUT D$(X): REM ---Correct it
355 GOTO 330: REM ---End of correct loop
370 N=N+1:GOSUB 2001:GOSUB 1200: REM ---Resave file header
375 GOSUB 2200:Q1=2*N+1:GOSUB 1200:REM ---Pack and save data on file in record n+1
380 GOSUB 1100: REM ---Close the file
399 GOTO 100: REM ---Return to the menu
400 REM ---This is the data inspection program---
401 GOSUB 1000: REM ---Open the file used for data storage---
405 Q1=1:GOSUB 1230:GOSUB 2100: REM ---Get file information and unpack it---
410 PRINT "Which record would you like to see?"
411 PRINT "0=none, 1=min, ";N;"=max ";:INPUT X
415 IF (X=0) THEN GOTO 495
420 IF (X>N) THEN PRINT "Invalid Record Number": GOTO 410
430 Q1= 2*X+1:GOSUB 1230: REM ---Get the desired record to look at
440 GOSUB 2300: REM ---Unpack the record---
450 FOR X=1 TO L(0):PRINT X;" ";Q$(X);RIGHT$(C$,25-LEN(Q$(X)));D$(X):NEXT X
460 INPUT "Another Record (Y or N)";W$
470 IF (W$="Y") OR (W$="y") THEN clearw 2:goto 405
495 GOSUB 1100: REM ---Close the file---
499 GOTO 100:REM ---Return to the menu---
500 REM ---This is the data change program---
505 GOSUB 1000: REM ---Open the file used for data storage---
510 Q1=1:GOSUB 1230:GOSUB 2100: REM ---Get file information and unpack it---
515 INPUT "Which record would you like to change ";Z
520 IF (Z<1) OR (Z>N) THEN 515: REM ---Not a legal record goto 515
525 Q1=2*Z+1:GOSUB 1230:GOSUB 2300: REM ---Get and unpack desired record---
530 FOR X=1 TO L(0):PRINT X;" ";Q$(X);RIGHT$(C$,25-LEN(Q$(X)));D$(X):NEXT X
535 INPUT "The number of the item to be changed & `0' if none ";I
540 IF I=0 THEN 580: REM ---Go store result---
545 IF (I<1) OR (I>L(0)) THEN 535: REM ---Illegal item number---
550 PRINT Q$(I);" Should be ";:INPUT D$(I): REM ---Input correct answer---
555 GOTO 530: REM ---Print out correct data and ask for more corrections---
580 GOSUB 2200:Q1=2*Z+1:GOSUB 1200:REM ---Pack and save data back onto disk---
590 GOSUB 1100:REM ---Close the file---
599 GOTO 100:REM --- Return to the menu---
600 REM ---This is the data search program---
601 GOSUB 1000:REM ---Open the file used for data storage---
605 Q1=1:GOSUB 1230:GOSUB 2100:REM ---Pack and save data back onto disk
610 FOR X=1 TO L(0):PRINT X;" ";Q$(X):NEXT X:REM ---List the fields---
620 INPUT "Which item would you like to search ";I
625 IF (I<1) OR (I>L(0)) THEN PRINT "Not a Valid Item": GOTO 620
627 INPUT "What should that item be ";E$
630 FOR Y=0 TO N:Q1=2*Y+1:GOSUB 1230:GOSUB 2300:REM ---Get and unpack each record---
640 IF E$=LEFT$(D$(I),LEN(E$)) THEN PRINT Y;LEFT$(B$,4-LEN(STR$(Y)));:FOR Z=1 TO L(0):PRINT D$(Z);" ";:NEXT Z:PRINT :REM ---If item found print record---
645 NEXT Y
660 INPUT "Another Search (Y or N)";E$
670 IF (E$="Y") OR (E$="y") THEN clearw 2:goto 610
690 GOSUB 1100: REM ---Close file---
699 GOTO 100:REM ---Return to the menu---
700 REM ---This is the data delete program---
705 GOSUB 1000: REM ---Open the file used for data storage---
710 Q1=1:GOSUB 1230:GOSUB 2100:REM ---Get file information and unpack it---
715 INPUT "Which record would you like to delete? `0'if none";I
720 IF (I=0) THEN 790: REM ---Don't delete any
725 IF (I>N) OR (I<0) THEN 715: REM ---Not a legal record---
730 IF (I=N) THEN 780: REM ---Delete last record---
735 FOR X=I TO N-1:Q1=2*X+3:GOSUB 1230:Q1=2*X+1:GOSUB 1200:NEXT X:REM ---Shift all following records---
780 N=N-1:GOSUB 2000:Q1=1:GOSUB 1200: REM --Reset the header back one pointer--
790 GOSUB 1100: REM --close the file ---
799 GOTO 100: REM ---Return to the menu---
800 END
1000 OPEN "R",1,F$:FIELD 1,127 AS B$:RETURN: REM ---Open file-all results=B$---
1100 CLOSE 1:RETURN:REM ---Close that file---
1199 REM ---PUT SUBROUTINE---
1200 IF LEN(A$)>127 THEN LSET B$=LEFT$(A$,127):PUT 1,Q1:LSET B$=RIGHT$(A$,(LEN(A$)-127)):PUT 1,Q1+1:RETURN